package me.huangxiang.design_pattern.command;

public class SimpleRemoteControl {
    private Command[] onCommands = new Command[7];
    private Command[] offCommands = new Command[7];

    public void setSlot(int slot, Command onCommand, Command offCommand){
        this.onCommands[slot] = onCommand;
        this.offCommands[slot] = offCommand;
    }

    public void onButtonClicked(int slot){
        this.onCommands[slot].execute();
    }

    public void offButtonClicked(int slot){
        this.offCommands[slot].execute();
    }
}
